using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace LS.Procedure
{
    /// <summary>
    /// 场景加载参数
    /// </summary>
    public class ProcedureDataLoadSceneParams : DataParamsBase
    {
        public static readonly string DataParamsKeyName = "ProcedureDataLoadSceneParams";
        /// <summary>
        /// 消息
        /// </summary>
        public string Message
        {
            get; set;
        }

        public bool UnloadCurrentScene { get; set; }

        /// <summary>
        /// 要加载的所有场景id
        /// </summary>
        public int[] SceneId { get; set; }

        /// <summary>
        /// 下一个接续的流程类型，在场景加载完成后切入至指定类型的流程。
        /// </summary>
        public Type NextProcedure { get; set; }

        /// <summary>
        /// 加载过程中播放的背景音乐
        /// </summary>
        public int? Bgm { get; set; }

        public static ProcedureDataLoadSceneParams Create(object userData, int[] sceneId, Type nextProcedure, string message = null, bool unloadCurrentScene = true, int? bgm = null)
        {
            ProcedureDataLoadSceneParams par = DataParamsBase.Create<ProcedureDataLoadSceneParams>();
            par.UserData = userData;
            par.SceneId = sceneId;
            par.Message = message;
            par.NextProcedure = nextProcedure;
            par.Bgm = bgm;
            par.UnloadCurrentScene = unloadCurrentScene;
            return par;
        }

        public override void Clear()
        {
            base.Clear();
            Message = null;
            SceneId = null;
            NextProcedure = null;
            Bgm = null;
            UnloadCurrentScene = true;
        }
    }
}
